<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
      <el-form-item label="订单号" prop="orderNumber">
        <el-input
          v-model="queryParams.orderNumber"
          placeholder="请输入项目订单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户名称" prop="hbName">
        <el-input
          v-model="queryParams.clientName"
          placeholder="请输入客户名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料名称" prop="itemName">
        <el-input
          v-model="queryParams.itemName"
          placeholder="请输入物料名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建日期" prop="createDate">
        <el-date-picker
          v-model="queryParams.createDate"
          type="date"
          placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="验算状态" prop="isYsed">
        <el-select v-model="queryParams.isYsed" placeholder="请选择">
          <el-option
            v-for="item in options2"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['sales:salesorder:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['sales:salesorder:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
        >导入</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['sales:salesorder:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-toilet-paper"
          size="mini"
          :disabled="multiple"
          @click="handYs"
          v-hasPermi="['sales:salesorder:edit']"
        >资源验算</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="salesorderList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="公司代码" align="center" prop="factoryCode" />
      <el-table-column label="公司名称" align="center" prop="factoryName"/>
      <el-table-column label="订单号" align="center" prop="orderNumber" width="150"/>
      <el-table-column label="订单类别" align="center" prop="orderType" >
        <template slot-scope="scope">
          <span v-if="scope.row.orderType=='1'">
            正式
          </span>
          <span v-if="scope.row.orderType=='0'">
            预测
          </span>
        </template>
      </el-table-column>
      <el-table-column label="合同号" align="center" prop="contractNo" width="140"/>
      <el-table-column label="客户编码" align="center" prop="clientNo" />
      <el-table-column label="客户名称" align="center" prop="clientName" width="230" show-overflow-tooltip/>
      <el-table-column label="订单数量" align="center" prop="number" />
      <el-table-column label="交货期" align="center" prop="deliveryDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.deliveryDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="物料编号" align="center" prop="itemCode" width="120"/>
      <el-table-column label="产品子编号" align="center" prop="itemSubCode" width="120"/>
      <el-table-column label="物料名称" align="center" prop="itemName" width="120" show-overflow-tooltip/>
      <el-table-column label="物料规格型号" align="center" prop="productModel" width="120"/>
<!--      <el-table-column label="供应商编码" align="center" prop="supplierCode" width="120" show-overflow-tooltip/>-->
<!--      <el-table-column label="供应商名称" align="center" prop="supplierName" width="120" show-overflow-tooltip/>-->
      <el-table-column label="创建人" align="center" prop="createBy" width="120"/>
      <el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
      <el-table-column label="编辑人" align="center" prop="updateBy" width="120"/>
      <el-table-column label="编辑时间" align="center" prop="updateTime" width="150"/>
      <el-table-column label="备注" align="center" prop="remark" width="260" show-tooltip-when-overflow/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            v-show="scope.row.isYsed=='0'"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['sales:salesorder:edit']"
          >编辑</el-button>
          <el-button
            size="mini"
            type="text"
            v-show="scope.row.isYsed=='0'"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['sales:salesorder:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改销售正式订单对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="公司代码" prop="factoryCode">
              <el-input v-model="form.factoryCode" placeholder="请输入公司代码">
                <el-button slot="append" icon="el-icon-search" @click="handleSelectOrganizational"></el-button>
              </el-input>
            </el-form-item>
            <OrganizationalSelect ref="organizationalSelect" @onSelected="onOrganizationalSelected" ></OrganizationalSelect>
          </el-col>
          <el-col :span="12">
            <el-form-item label="公司名称" prop="factoryName">
              <el-input v-model="form.factoryName" placeholder="请输入公司名称"/>
            </el-form-item>
          </el-col>

        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="合同号" prop="contractNo">
              <el-input v-model="form.contractNo" placeholder="请输入合同号" readonly/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="订单号" prop="orderNumber">
              <el-input v-model="form.orderNumber" placeholder="请输入订单号" readonly/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="客户代码" prop="clientNo">
              <el-input v-model="form.clientNo" placeholder="请输入客户代码" readonly/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="客户名称" prop="clientName">
              <el-input v-model="form.clientName" placeholder="请输入客户名称" readonly/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="物料编码" prop="itemCode">
              <el-input v-model="form.itemCode" placeholder="请输入物料编码" />
            </el-form-item>
          </el-col>
<!--          <el-col :span="12">-->
<!--            <el-form-item label="物料子编号" prop="itemSubCode">-->
<!--              <el-input v-model="form.itemSubCode" placeholder="请输入物料子编号" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
          <el-col :span="12">
            <el-form-item label="物料名称" prop="itemName">
              <el-input v-model="form.itemName" placeholder="请输入物料名称" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="规格型号" prop="productModel">
              <el-input v-model="form.productModel" placeholder="请输入规格型号" />
            </el-form-item>
          </el-col>
<!--          <el-col :span="12">-->
<!--            <el-form-item label="物料识别码" prop="itemIdentifyCode">-->
<!--              <el-input v-model="form.itemIdentifyCode" placeholder="请输入物料识别码" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="12">-->
<!--            <el-form-item label="供应商代码" prop="supplierCode">-->
<!--              <el-input v-model="form.supplierCode" placeholder="请输入供应商代码" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="12">-->
<!--            <el-form-item label="供应商名称" prop="supplierName">-->
<!--              <el-input v-model="form.supplierName" placeholder="请输入供应商名称" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
          <el-col :span="12">
            <el-form-item label="数量" prop="number">
              <el-input v-model="form.number" placeholder="请输入数量" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="交货期" prop="deliveryDate">
              <el-date-picker clearable
                              v-model="form.deliveryDate"
                              type="date"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择交货期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :close-on-click-modal="false" title="拆分行" :visible.sync="open2" width="500px" append-to-body>
      <el-form ref="form2" :model="form2" :rules="rules" label-width="100px">
        <el-row>
          <el-col>
            <el-form-item>
              <span style="font-size: 16px;padding-left: 40px">拆分成 <el-input v-model="form2.splitRow" placeholder="行数" style="width:80px"/> 行</span>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm2">确 定</el-button>
        <el-button @click="cancel2">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <!--  <div class="el-upload__tip" slot="tip">
              <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
            </div>-->
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listSalesorder,
  getSalesorder,
  delSalesorder,
  addSalesorder,
  updateSalesorder,
  pushSalesorder, splitSalesorder,getSimpleCode
} from "@/api/sales/salesorder";
import {handYs} from "@/api/pcplan/orderResourcesYs";
import {getToken} from "@/utils/auth";
import {getLiSupplier,} from "@/api/supplychain/supplier";
import OrganizationalSelect  from "@/components/organizationalSelect/index";
import moment from "moment/moment";

export default {
  name: "Salesorder",
  dicts: ['outsour_type'],
  components :{OrganizationalSelect},
  data() {
    return {
      // 遮罩层
      loading: true,
      outTypeShowFlag: false,
      supplierShowFlag: false,
      wxNumShowFlag: false,
      zcNumShowFlag: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      cfbj: false,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 销售正式订单表格数据
      salesorderList: [],
      filesList: [],
      options2: [{
        label: '全部',
        value: null
      },{
        label: '已验算',
        value: '1'
      }, {
        label: '未验算',
        value: '0'
      }],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      open2: false,
      options: [{
        value: '0',
        label: '下料线'
      }, {
        value: '1',
        label: '1吨线'
      }, {
        value: '2',
        label: '750线'
      }, {
        value: '3',
        label: '560线'
      }, {
        value: '4',
        label: '250线'
      }],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        factoryCode: null,
        factoryName: null,
        orderType: null,
        specialRequirements: null,
        orderNumber: null,
        productState: null,
        orderState: null,
        auditUser: null,
        auditTime: null,
        auditWorkshop: null,
        configType: null,
        number: null,
        deliveryDate: null,
        noPcNum: null,
        yuPcNum: null,
        pcNum: null,
        scNum: null,
        finishNum: null,
        pcJss: null,
        productOrderType: null,
        productModel: null,
        baseItemNum: null,
        pzkItemNum: null,
        zcXzNo: null,
        configNo: null,
        configRequire: null,
        oDeliveryDate: null,
        color: null,
        pcState: null,
        cccNotice: null,
        gxbNotice: null,
        rejectReason: null,
        clientNo: null,
        truckType: null,
        country: null,
        user: null,
        jyPcCj: null,
        slDpLx: null,
        noticeOrderNo: null,
        isEmergency: null,
        series: null,
        qdxs: null,
        newCarType: null,
        newCarInstruction: null,
        tecConfirmState: null,
        tecConfirmInfo: null,
        orderTime: null,
        tecConfirmTime: null,
        emeConfirmTime: null,
        isYsed:null,
        createDate:new Date()
      },
      //正式/试制/研发/未立项
      prodcteState: [{
        value: '1',
        label: '正式'
      }, {
        value: '2',
        label: '试制'
      },{
        value: '3',
        label: '研发'
      },{
        value: '4',
        label: '未立项'
      }],
      orderState: [{
        value: '0',
        label: '未执行'
      }, {
        value: '1',
        label: '已执行'
      }],
      zfbj: [{
        value: '0',
        label: '作废'
      }, {
        value: '1',
        label: '启用'
      }],
      sfjd: [{
        value: '0',
        label: '否'
      }, {
        value: '1',
        label: '是'
      }],
      prodWays: [{
        value: '1',
        label: '自产'
      }, {
        value: '2',
        label: '外协'
      }],
      // 表单参数
      form: {

      },
      // 表单参数
      form2: {
        id:null
      },
      upload: {
        // 是否显示弹出层（物料导入）
        open: false,
        // 弹出层标题（物料导入）
        title: "导入订单信息",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/sales/salesorder/importData"
      },
      // 表单校验
      rules: {
      }
    };
  },
  watch:{
    $router(){
      this.getList();
    }
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询销售正式订单列表 */
    getList() {
      this.loading = true;
      this.queryParams.createDate = moment.utc(this.queryParams.createDate).local().format('YYYY-MM-DD')
      if(this.queryParams.createDate == 'Invalid date'){
        this.queryParams.createDate = null
      }
      listSalesorder(this.queryParams).then(response => {
        this.salesorderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    tableRowClassName({row, rowIndex}) {
      if (row.isYsed === '0') {
        return 'warning-row';
      }
      else if(row.isYsed === '1'){
        return 'success-row';
      }
      return '';
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    cancel2() {
      this.open2 = false;
      this.form2.row=null;
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        factoryCode: null,
        factoryName: null,
        orderType: null,
        specialRequirements: null,
        orderNumber: null,
        productState: null,
        orderState: null,
        auditUser: null,
        auditTime: null,
        auditWorkshop: null,
        configType: null,
        number: null,
        deliveryDate: null,
        noPcNum: null,
        yuPcNum: null,
        pcNum: null,
        scNum: null,
        finishNum: null,
        pcJss: null,
        productOrderType: null,
        productModel: null,
        baseItemNum: null,
        pzkItemNum: null,
        zcXzNo: null,
        configNo: null,
        configRequire: null,
        oDeliveryDate: null,
        color: null,
        pcState: null,
        cccNotice: null,
        gxbNotice: null,
        rejectReason: null,
        clientNo: null,
        truckType: null,
        country: null,
        user: null,
        jyPcCj: null,
        slDpLx: null,
        noticeOrderNo: null,
        isEmergency: null,
        series: null,
        qdxs: null,
        newCarType: null,
        newCarInstruction: null,
        tecConfirmState: null,
        tecConfirmInfo: null,
        orderTime: null,
        tecConfirmTime: null,
        emeConfirmTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加销售正式订单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getSalesorder(id).then(response => {
        getLiSupplier().then(res => {
          this.filesList = res.data
          this.form = response.data;
          this.open = true;
          this.title = "修改销售正式订单";
          if(response.data.prodWay == '2'){
            this.outTypeShowFlag = true;
            this.supplierShowFlag = true;
            this.wxNumShowFlag = true;
            this.zcNumShowFlag = true;
          }else{
            this.outTypeShowFlag = false;
            this.supplierShowFlag = false;
            this.wxNumShowFlag = false;
            this.zcNumShowFlag = false;
          }
          if(response.data.cfbj=='1'){
            this.cfbj = true
          }
          });
      });
    },
    changeWay(val){
      if (val=='2'){
        this.outTypeShowFlag = true;
        this.supplierShowFlag = true;
        this.wxNumShowFlag = true;
        this.zcNumShowFlag = true;
      }else{
        this.outTypeShowFlag = false;
        this.supplierShowFlag = false;
        this.wxNumShowFlag = false;
        this.zcNumShowFlag = false;
        this.form.outsourType = "";
        this.form.wxNum = 0;
        this.form.zcNum = 0;
        this.form.outsourType =  "";
        this.form.supplierCode =  "";
      }
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            if(this.form.prodWay == '2'){
              if(!this.form.outsourType){
                this.$modal.msgSuccess("请选择外协类型！");
                return;
              }
              if(!this.form.supplierCode){
                this.$modal.msgSuccess("请选择供应商！");
                return;
              }
            }
            let yupc = this.form.yuPcNum;
            let orderNum = this.form.number;
            if(yupc>orderNum){
              this.$modal.msgSuccess("预排数量不能大于订单数量，请重新输入！");
              return;
            }
            updateSalesorder(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSalesorder(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    submitForm2(){
      splitSalesorder(this.form2).then(response => {
        this.$modal.msgSuccess("拆分成功");
        this.open2 = false;
        this.form2.splitRow = null
        this.getList();
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除销售正式订单编号为"' + ids + '"的数据项？').then(function() {
        return delSalesorder(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    handleSplit(row){
      this.form2.id = row.id;
      this.open2=true
    },
    upadteZcNum(){
      this.form.zcNum = this.form.yuPcNum-this.form.wxNum;
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('sales/salesorder/export', {
        ...this.queryParams
      }, `salesorder_${new Date().getTime()}.xlsx`)
    },
    handlePush(row){
      const loading = this.$loading({
        lock: true,
        text: '正在生成排产，请稍后...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });

      const ids = row.id || this.ids;
      pushSalesorder(ids).then(response => {
        if(response.code==500){
          this.$modal.msgError(response.msg);
        }else{
          this.$modal.msgSuccess("审核成功！");
          this.getList();
          this.$router.push('/pcplansystem/propcmanage/productPreSchedulingPlanMain')
        }
        loading.close();
      }).catch(reason=>{
        loading.close();
      });
    },
    handleImport() {
      this.upload.title = "订单导入";
      this.upload.open = true;
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download('sales/salesorder/importTemplate', {
      }, `订单数据模板.xlsx`)
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
      this.getList();
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
    handYs(row) {
      const loading = this.$loading({
        lock: true,
        text: '正在生成验算结果，请稍后...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      const ids = row.id || this.ids;
      handYs(ids).then(response => {
        this.getList();
        this.$modal.msgSuccess("验算成功！");
        loading.close();
      }).catch(reason=>{
        loading.close();
      });

    },
    handleSelectOrganizational(){
      this.$refs.organizationalSelect.showFlag = true;
    },
    onOrganizationalSelected(obj){
      if(obj != undefined && obj != null){
        this.form.factoryCode = obj.jtdm;
        this.form.factoryName = obj.jtmc;
      }
    },
  }
};
</script>

<style>
.el-table .warning-row {
  background: #ffe4e1;
}

.el-table .success-row {
  background: oldlace
}
</style>
